/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package components.shapemenu;

import PCR.MainFrame;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JCheckBoxMenuItem;

/**
 *
 * @author icdev
 */
public class CheckMenuAction implements ActionListener {

    @Override
    public void actionPerformed(ActionEvent e) {
        MainFrame frm = (MainFrame) java.awt.Window.getWindows()[0];
        JCheckBoxMenuItem curMenu = (JCheckBoxMenuItem) e.getSource();
        if (curMenu.getText().equals("Lock")) {
            if (curMenu.isSelected()) {
                frm.getSeletedShape().setMovable(false);
                frm.getSeletedShape().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
            } else {

                frm.getSeletedShape().setMovable(true);
                frm.getSeletedShape().setCursor(Cursor.getPredefinedCursor(Cursor.MOVE_CURSOR));
            }
        }
    }
}
